Style Attributes
Each style object has a set of style attributes, which are a group of flags that modify the behavior of the style object. In particular, these flags allow you to specify how QuickDraw GX places the pen with respect to a shape's geometry and whether the shape should be constrained to a grid. These constants are defined in thegxStyleAttributes
enumeration:
enum gxStyleAttributes { gxCenterFrameStyle = 0, gxSourceGridStyle = 0x0001, gxDeviceGridStyle = 0x0002, gxInsideFrameStyle = 0x0004, gxOutsideFrameStyle = 0x0008, gxAutoInsetStyle = 0x0010 }; typedef long gxStyleAttribute;Constant descriptions
Setting both the
gxCenterFrameStyle
- Indicates that QuickDraw GX should center the geometric pen along the shape's contours.
gxSourceGridStyle
- Constrains the geometric points of the shape in geometry space. When drawing a shape whose style object has this flag set, QuickDraw GX moves each geometric point of the shape's geometry to the closest integral position before applying the shape's style and transform. (Note that the original geometric points are unchanged; this operation occurs only as the shape is being drawn.) See "Grids" beginning on page 3-20 for more information.
gxDeviceGridStyle
- Constrains the geometric points of the shape in device space. When drawing a shape whose style object has this flag set, QuickDraw GX moves the shape's geometric points, after applying the shape's style and transform, to the closest integral position (that is, pixel position) in the device space. (Note that the original geometric points are unchanged; this operation occurs only as the shape is being drawn.) See "Grids" beginning on page 3-20 for more information.
gxInsideFrameStyle
- Indicates that QuickDraw GX should position the pen along the inside of the shape's contours. By default, QuickDraw GX uses the direction of a contour to determine which side is the inside; the right side of a contour is considered the inside.
gxOutsideFrameStyle
- Indicates that QuickDraw GX should place the pen along the outside of the shape's contours. By default, QuickDraw GX uses the direction of a contour to determine which side is the inside; the left side of a contour is considered the outside.
gxAutoInsetStyle
Alters the default definition of the inside and outside of a contour. When this flag is not set, QuickDraw GX assumes the right side of a contour is the inside and the left side of a contour is the outside (which provides the correct behavior for TrueType fonts). When thegxAutoInsetStyle
flag is set, QuickDraw GX finds the true inside of each contour, regardless of the contour direction.gxInsideFrameStyle
andgxOutsideFrameStyle
style attributes results in theinconsistent_parameters
error.See "Grids" on page 3-20 and "Constraining Shape Geometries to Grids" beginning on page 3-40 for details about how QuickDraw GX constrains shapes to a grid. See "The Geometric Pen" on page 3-15 and "Manipulating Pen Width and Placement" on page 3-51 for examples of pen placement.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help